package com.tt.job.common.cluster;

/**
 * TODO info
 **/
public abstract class AbstractInvoker implements Invoker {
    private final String serviceName;
    private int weight = 0;

    public AbstractInvoker(String serviceName) {
        this.serviceName = serviceName;
    }

    @Override
    public String getServiceName() {
        return serviceName;
    }

    @Override
    public int getWeight() {
        return weight;
    }

    @Override
    public <T> InvokeResult<T> invoke(Invocation invocation, Class<T> classT) throws Exception {
        //TODO 从连接池中获取一个连接

        //执行方法

        //放回连接
        return null;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }
}
